package com.kaikai.edusta.controller;


import com.kaikai.commonutils.R;
import com.kaikai.edusta.client.UcenterClient;
import com.kaikai.edusta.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author yujiankai
 * @since 2021-06-20
 */
@RestController
@CrossOrigin
@RequestMapping("/edusta/statistics-daily")
public class StatisticsDailyController {
    @Autowired
    private UcenterClient ucenterClient;
    @Autowired
    private StatisticsDailyService dailyService;
    @PostMapping("{day}")
    public R createStatisticsByDate(@PathVariable String day){
        dailyService.createStatisticsByDate(day);
        return R.ok();
    }
    @GetMapping("{type}/{begin}/{end}")
    public R createStaByCondition(@PathVariable String type,
                                  @PathVariable String begin,
                                  @PathVariable String end) {

        Map map =dailyService.createStaByCondition(type,begin,end);
        return R.ok().data(map);
    }
}

